package com.sc.nft.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.dto.ExternalLinkWebDTO;
import com.sc.nft.entity.vo.AdminExternalLinkListVO;
import com.sc.nft.service.ExternalLinkService;
import com.sc.nft.sup.PageResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/externalLink")
@Api(tags = "外链操作")
public class ExternalLinkController {

    private final ExternalLinkService externalLinkService;


    @PostMapping(value = "/page", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "获取用户的外链列表", notes = "后台获取用户的外链列表", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    public PageResult<Page<AdminExternalLinkListVO>> page(@Validated @RequestBody ExternalLinkWebDTO externalLinkWebDTO) {
        return PageResult.success(externalLinkService.webPage(externalLinkWebDTO));
    }
}
